package com.haojiu.service;

import com.github.pagehelper.PageHelper;
import com.haojiu.mapper.NoticeMapper;
import com.haojiu.pojo.Notice;

import java.util.List;

/**
 * @author:我叫浩九
 * @date：2021/8/27 20:56
 * create in RuGao JiangSu
 */
public class NoticeServiceImpl implements NoticeService{
    private NoticeMapper noticeMapper;
    public void setNoticeMapper(NoticeMapper noticeMapper){
        this.noticeMapper=noticeMapper;
    }
    @Override
    public int addNotice(Notice notice) {
        return noticeMapper.addNotice(notice);
    }

    @Override
    public Notice queryNoticeByTheme(String noticeTheme) {
      return noticeMapper.queryNoticeByTheme(noticeTheme);
    }

    @Override
    public int deleteNoticeByTheme(String noticeTheme) {
        return noticeMapper.deleteNoticeByTheme(noticeTheme);
    }

    @Override
    public int updateNotice(Notice notice) {
        return noticeMapper.updateNotice(notice);
    }

    @Override
    public List<Notice> queryAllNotice(int page,int size) {
        PageHelper.startPage(page,size);
        return noticeMapper.queryAllNotice();
    }

    @Override
    public List<Notice> queryAllNotice() {
        return noticeMapper.queryAllNotice();
    }
}
